/*
 * Copyright 2016-2019 yoara
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package yhao.infra.feature.payment.core.alipaynew.config;

/**
 * ali支付配置生成类
 *
 * @author yoara
 */
public class AliPayConfig {
    private AliPayConfig(){}

    public static AliPayConfig generateConfig(String notify_url_pre, String return_url, String aliPay_gateWay,
                                              String seller_id, String app_id, String app_private_key, String ali_public_key,
                                              String time_out_express) {
        AliPayConfig config = new AliPayConfig();
        config.notify_url_pre = notify_url_pre;
        config.return_url 		= return_url;
        config.aliPay_gateWay = aliPay_gateWay;
        config.seller_id = seller_id;
        config.app_id = app_id;
        config.app_private_key = app_private_key;
        config.ali_public_key = ali_public_key;
        config.time_out_express = time_out_express;
        //config.sign_type 		= env.getProperty("alipay.sign_type","RSA2");
        //config.partner 		= env.getProperty("alipay.partner");
        //config.seller_email 	= env.getProperty("alipay.seller_email");
        return config;
    }

    //支付宝请求地址
    private String aliPay_gateWay;

    //回调需http://格式的完整路径前缀
    private String notify_url_pre;

    private String app_id;

    private String seller_id;

    private String return_url;
    // 商户的私钥
    private String app_private_key;
    // 支付宝的公钥，无需修改该值
    private String ali_public_key;
    //设置未付款交易的超时时间
    private String time_out_express;
    // 字符编码格式 目前支持 gbk 或 utf-8
    private String charset = "utf-8";
    //目前支持RSA2和RSA，推荐使用RSA2
    private String sign_type = "RSA2";

    public String getAliPay_gateWay() {
        return aliPay_gateWay;
    }

    public String getSeller_id() {
        return seller_id;
    }

    public String getApp_id() {
        return app_id;
    }

    public String getTime_out_express() {
        return time_out_express;
    }

    public String getApp_private_key() {
        return app_private_key;
    }

    public String getCharset() {
        return charset;
    }

    public String getReturn_url() {
        return return_url;
    }

    public String getAli_public_key() {
        return ali_public_key;
    }

    public String getSign_type() {
        return sign_type;
    }

    public String getNotify_url_pre() {
        return notify_url_pre;
    }
}